/*
 * @Author: wuheng wuheng@szhbzc.com
 * @Date: 2025-03-19 17:38:09
 * @LastEditors: wuheng wuheng@szhbzc.com
 * @LastEditTime: 2025-03-22 10:28:27
 * @FilePath: \hbzc-groupmeal-center-web\src\api\incomeStatistics.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/newrequst";

//收入统计分页
export const getStatisticsListApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-statistics/page`, method: "post", data
  });
};
// 收入类型分页
export const getIncomeCategoryListApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-category/page`, method: "post", data
  });
};
// 获取收入来源数组
export const getIncomeSourceListApi = (data: any) => {
  return request({
    url: `/report/v1/public/income-source/list`, method: "post", data
  });
};
// 新增收入类型
export const addIncomeCategoryApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-category/add`, method: "post", data
  });
};
// 编辑收入类型
export const editIncomeCategoryApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-category/add`, method: "post", data
  });
};
// 导出收入统计
export const DownStatisticsxcelApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-statistics/export-excel`, method: "post", data,
    responseType: 'blob'
  });
};
// 导入收入统计
export const incomeImportExcel = `${import.meta.env.VITE_APP_BASE_API}/report/v1/center/income-statistics/import-excel`

//分页查询收入统计导入历史
export const getImportHistory = (data: any) => {
  return request({
    url: `/report/v1/center/income-statistics-import-history/page`, method: "post", data
  });
};

//查询收入汇总
export const getIncomeSummary = (data: any) => {
  return request({
    url: `/report/v1/center/income-summary/page`, method: "post", data
  });
};

// 导出收入明细excel模板
export const DownteplateStatisApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-statistics/download-excel-template`, method: "post", data,
    responseType: 'blob'
  });
};
// 收入汇总导出
export const DownincomesummaryApi = (data: any) => {
  return request({
    url: `/report/v1/center/income-summary/export-excel`, method: "post", data,
    responseType: 'blob'
  });
};